$OpenBSD: patch-klinkstatus_cmake_modules_FindLibTidy_cmake,v 1.1 2013/04/24 20:07:20 zhuk Exp $
--- klinkstatus/cmake/modules/FindLibTidy.cmake.orig	Mon Dec 10 09:23:53 2012
+++ klinkstatus/cmake/modules/FindLibTidy.cmake	Mon Dec 10 09:46:11 2012
@@ -17,19 +17,19 @@ if (LIBTIDY_INCLUDE_DIR)
   set(LibTidy_FIND_QUIETLY TRUE)
 endif (LIBTIDY_INCLUDE_DIR)
 
-FIND_PATH(LIBTIDY_INCLUDE_DIR tidy.h)
+FIND_PATH(LIBTIDY_INCLUDE_DIR tidyp.h PATH_SUFFIXES tidyp)
+if( LIBTIDY_INCLUDE_DIR )
+    set(HAVE_TIDYP 1 CACHE STRING "Libtidyp is used instead of Libtidy")
+    set(LIBTIDY_MAIN_HEADER tidyp.h)
+endif( LIBTIDY_INCLUDE_DIR )
+FIND_PATH(LIBTIDY_INCLUDE_DIR tidy.h PATH_SUFFIXES tidy)
+if( LIBTIDY_INCLUDE_DIR )
+    set(HAVE_TIDYP 0 CACHE STRING "Libtidyp is used instead of Libtidy")
+    set(LIBTIDY_MAIN_HEADER tidy.h)
+endif( LIBTIDY_INCLUDE_DIR )
 
-if( NOT LIBTIDY_INCLUDE_DIR )
-    find_path(LIBTIDY_INCLUDE_DIR tidy.h PATH_SUFFIXES tidy)
-    #now tidy.h was inside a tidy subdirectory so we need to
-    #add that to the include dir
-    set(LIBTIDY_INCLUDE_DIR ${LIBTIDY_INCLUDE_DIR}/tidy CACHE PATH "Libtidy include directory")
-endif( NOT LIBTIDY_INCLUDE_DIR )
+FIND_LIBRARY(LIBTIDY_LIBRARIES NAMES tidyp tidy)
 
-
-
-FIND_LIBRARY(LIBTIDY_LIBRARIES NAMES tidy)
-
 if (LIBTIDY_INCLUDE_DIR AND LIBTIDY_LIBRARIES)
    set(LIBTIDY_FOUND TRUE)
 endif (LIBTIDY_INCLUDE_DIR AND LIBTIDY_LIBRARIES)
@@ -41,7 +41,7 @@ if (LIBTIDY_FOUND)
    endif (NOT LibTidy_FIND_QUIETLY)
 
     SET(CHECK_TIDY_ULONG_SOURCE_CODE "
-#include <${LIBTIDY_INCLUDE_DIR}/tidy.h>
+#include \"${LIBTIDY_INCLUDE_DIR}/${LIBTIDY_MAIN_HEADER}\"
 
 int main()
 {
